<template>
	<uni-popup ref="customer_pop">
		
		<view class="customer_pop">
			<!-- <image class="close" src="../../static/transaction/close.png" @click="close()"></image> -->
			<view class="text1">官方QQ群</view>
			
			
			<view class="text2">
				
			</view>
			
			
			<view class="text3">
				<image class="contact_us" :src="url"></image>
			</view>
			<view class="text2">QQ扫码 添加客服</view>
		
			
			<view class="text4" >
				<view class="text5" @click="copy()">保存图片</view>
			</view>
			
			<view class="black_1" >
				<view class="text6" @click="close()">取消</view>
			</view>
		</view>
		

	</uni-popup>
	
</template>

<script>
	export default {
		// props:{
		// 	url:{
		// 		type:String,
		// 		default:'1',
		// 	}
		// },
		name:"customer",
		data() {
			return {
				url:''
			};
		},
		methods:{
			close(){
				this.$refs.customer_pop.close()
			},
			open(type){
				this.url =uni.getStorageSync('contact_us')
				this.$refs.customer_pop.open(type)
			},
			copy(){
				var that =this
				uni.saveImageToPhotosAlbum({
					filePath: this.url,
					success: function(res) {
						uni.showToast({
							title: '保存相册成功'
						});
						console.log('save success');
					},
					fail(res) {
						console.log(res);
						if (res.errMsg == 'saveImageToPhotosAlbum:fail auth deny') {
							uni.showModal({
								title: '您需要授权相册权限',
								success(res) {
									if (res.confirm) {
										uni.openSetting({
											success(res) {},
											fail(res) {
												console.log(res);
											}
										});
									}
								}
							});
						}
					}
				});
						
				that.close()
			}
		}
	}
</script>

<style scoped lang="less">

.customer_pop{
	width: 580rpx;
	background: #ffffff;
	border-radius: 10rpx;
	padding: 40rpx 20rpx 40rpx 20rpx;
	text-align: center;
	.close{
		width: 40rpx;
		height: 40rpx;
		position: absolute;
		right: 40rpx;
	}
	.text1{
		
		font-size: 35rpx;
		font-weight: 400;
		color: #111111;
	}
	
	.text2{
		font-size: 30rpx;
		font-weight: 400;
		color: #1C1C1C;
	}
	
	.text3{
		margin-top: 60rpx;
		font-size: 46rpx;
		font-weight: bold;
		color: #FE903D;
		.contact_us{
			width: 200px;
			height: 200px;
	
		}
	}
	
	
	.text4{
		
		color: #B88045;
		font-size: 30rpx;
		font-weight: bold;
		
		.text5{
			background-color: #3B61FF;
			border-radius: 20px;
			// background: url(../../static/my/btn_6.png) no-repeat;
			background-size: 100% 100%, contain;
			margin:50rpx 20px 20rpx 20px;
			color: white;
			padding: 10px;
			
		}
		
	}
}

.black_1{
	font-size: 35rpx;
	font-weight: 400;
	color: #BFBFBF;
	text-align: center;
	margin-top: 20px;
	.text6{
		font-size: 35rpx;
	}
}
</style>